package org.naivecoders.ai;

import org.naivecoders.ai.functions.AbstractFunction;
import org.naivecoders.ai.functions.ConstantFunction;
import org.naivecoders.ai.functions.ListAppendHeadFunction;
import org.naivecoders.ai.functions.ListHeadFunction;
import org.naivecoders.ai.types.Bowl;
import org.naivecoders.ai.types.MaybeBowl;

public class Funcai {

	private static AbstractFunction createConcat(AbstractFunction f1,
			AbstractFunction f2) {
		
		final AbstractFunction headAppend = new ListAppendHeadFunction();
		final AbstractFunction listHead = new ListHeadFunction();
		listHead.addInput(f1);
		headAppend.addInput(listHead);
		headAppend.addInput(f2);
		
		// here is a outline of how append should work
		// appendHead(head(L1),appendRecursively(tail(L1), L2))
		// appendHead(head(L1), appendHead(head(tail(L1)), L2))
	}

	public static void main(String[] args) {
		// for the given input
		// produce a flat bowl of size equivalent to number of all
		// elements in the input
		final ConstantFunction inputTree = new ConstantFunction(
				MaybeBowl.newBowl(Bowl
						.parseBracketNotation("[ [[][][]] [[][]] [][] [[ [] [[]] ]] ]")));
		System.out.println(inputTree.evaluate());

		final String target = "[][][][][][]";
	}
}
